package com.tianmu.demo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.tianmu.TianmuSDK;
import com.tianmu.biz.bean.DownloadTipType;
import com.tianmu.config.TianmuInitConfig;
import com.tianmudemo.R;
import com.tianmu.demo.ad.BannerAdActivity;
import com.tianmu.demo.ad.InterstitialAdActivity;
import com.tianmu.demo.ad.NativeExpressAdActivity;
import com.tianmu.demo.ad.SplashAdActivity;
import com.tianmu.demo.constant.TianmuDemoConstant;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TianmuSDK.getInstance().init(this, new TianmuInitConfig.Builder()
                .appId(TianmuDemoConstant.APP_ID)
                .debug(true)
                .agreePrivacyStrategy(true)
                .isCanUseLocation(true)
                .isCanUsePhoneState(true)
                .isCanUseWifiState(true)
                .isCanUseOAID(true)
                .isCanUseAAID(true)
                .isCanUseVAID(true)
                .downloadTipType(DownloadTipType.TYPE_ALL)
                .isFlag(true)
                .isSandbox(true)
                .setOAID("请传入oaid")
                .setAAID("请传入aaid")
                .setVAID("请传入vaid")
                .build());

        findViewById(R.id.tvSplashAd).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, SplashAdActivity.class));
            }
        });

        findViewById(R.id.tvBanner).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, BannerAdActivity.class));
            }
        });

        findViewById(R.id.tvNative).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, NativeExpressAdActivity.class));
            }
        });

        findViewById(R.id.tvInterstitial).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, InterstitialAdActivity.class));
            }
        });
    }

}